<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:composite="http://xmlns.jcp.org/jsf/composite">

	<composite:interface>
		<composite:attribute name="axis" required="true" type="org.plotfaces.model.Axis"/>
		<composite:attribute name="collapseHandler" required="true" type="org.plotfacesdemo.CollapseHandler"/>
		<composite:attribute name="plot" required="true" type="java.lang.String"/>
	</composite:interface>

    <composite:implementation>
		<!--
			All message resources should have the _axisGeneral suffix.
		-->

		<p:panel id="axisGeneral" closable="false" toggleable="true" collapsed="#{not cc.attrs.collapseHandler.isVisible('axisGeneral')}" header="#{msg.general}">
			<p:ajax event="toggle" listener="#{cc.attrs.collapseHandler.handleToggle}"/>
			<p:panelGrid id="axisGeneralGrid" columns="3">
				<h:panelGroup>
					#{msg.show_axisGeneral}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.hidden}" onLabel="#{msg.shown}" value="#{cc.attrs.axis.show}" rendered="#{cc.attrs.axis.show != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<!--<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.axis.setShow( true )}" rendered="#{cc.attrs.axis.show == null}" update="axisGeneralGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.show != null}" update="axisGeneralGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.show}" value="#{null}" />
					</p:commandButton>-->
				</h:panelGroup>
				<h:panelGroup>
					#{msg.show_axisGeneral_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.useSeriesColor_axisGeneral}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.notUsed}" onLabel="#{msg.used}" value="#{cc.attrs.axis.useSeriesColor}" rendered="#{cc.attrs.axis.useSeriesColor != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" actionListener="#{cc.attrs.axis.setUseSeriesColor( true )}" rendered="#{cc.attrs.axis.useSeriesColor == null}" update="axisGeneralGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.useSeriesColor != null}" update="axisGeneralGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.useSeriesColor}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.useSeriesColor_axisGeneral_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.autoScale_axisGeneral}
				</h:panelGroup>
				<h:panelGroup>
					<p:selectBooleanButton offLabel="#{msg.manual}" onLabel="#{msg.automatic}" value="#{cc.attrs.axis.autoScale}" rendered="#{cc.attrs.axis.autoScale != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
					</p:selectBooleanButton>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setAutoScale( true )}" rendered="#{cc.attrs.axis.autoScale == null}" update="axisGeneralGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.autoScale != null}" update="axisGeneralGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.autoScale}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.autoScale_axisGeneral_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.minimum_axisGeneral}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.axis.min}" rendered="#{cc.attrs.axis.min != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
						<f:convertNumber/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setMin( 0.0 )}" rendered="#{cc.attrs.axis.min == null}" update="axisGeneralGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.min != null}" update="axisGeneralGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.min}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.minimum_axisGeneral_notes}
				</h:panelGroup>

				<h:panelGroup>
					#{msg.maximum_axisGeneral}
				</h:panelGroup>
				<h:panelGroup>
					<p:inputText value="#{cc.attrs.axis.max}" rendered="#{cc.attrs.axis.max != null}">
						<p:ajax update="#{cc.attrs.plot}"/>
						<f:convertNumber/>
					</p:inputText>

					<p:commandButton value="#{msg.initialize}" action="#{cc.attrs.axis.setMax( 10.0 )}" rendered="#{cc.attrs.axis.max == null}" update="axisGeneralGrid #{cc.attrs.plot}"/>
					<p:commandButton value="#{msg.reset}" rendered="#{cc.attrs.axis.max != null}" update="axisGeneralGrid #{cc.attrs.plot}">
						<f:setPropertyActionListener target="#{cc.attrs.axis.max}" value="#{null}" />
					</p:commandButton>
				</h:panelGroup>
				<h:panelGroup>
					#{msg.maximum_axisGeneral_notes}
				</h:panelGroup>
			</p:panelGrid>
		</p:panel>
	</composite:implementation>
</html>

